package leetcode.code0551;

public class Solution {
	public boolean checkRecord(String s) {
		int a = 0, l = 0;
		for (char c : s.toCharArray()) {
			if (c == 'A') {
				a++;
				l = 0;
			} else if (c == 'L') {
				l++;
			} else if (c == 'P') {
				l = 0;
			}
			if (a == 2) {
				return false;
			}

		}
		return true;
	}
}
